package fatworm.query;

import fatworm.query.expression.Term;
import fatworm.storage.table.*;

public class Predicate {
	
	private Term term;
	
	public Predicate(Term term) {
		this.term = term;
	}
	
	public boolean isOK(Scan s) {
		if (term == null)
			return true;
		else
			return term.isOK(s);
	}
	
	public Predicate filter(Schema sch) {
		// TODO
		return null;
	}
	
	public Predicate join(Schema sch1, Schema sch2) {
		//TODO
		return null;
	}
	
	public int reductionFactor(Plan p) {
		return term.reductionFactor(p);
	}
	
	public String toString() {
		return term.toString();
	}
}